<?php


namespace app\shop\model\user;


use app\shop\model\order\OrderModel;
use think\Model;

class DesignScoreModel extends Model
{
    protected $name = 'design_score';
    protected $autoWriteTimestamp = true;

    public function user()
    {
        return $this->hasOne(UserModel::class, 'user_id', 'user_id')->bind([
            'realname', 'avatar', 'user_score' => 'score', 'user_work_score' => 'work_score'
        ]);
    }

    public function orders()
    {
        return $this->hasOne(OrderModel::class, 'id', 'order_id')->bind(['order_name']);
    }
}